<template>
	<div class="questions">
		
		<div class="questions-div">
			
			<div class="questions-body">
				<div class="tr4"  v-for="(item,index) in body">
					<div class="tr-div"
						v-for="(twoitem,twoindex) in item"
						:style="{'background':twoitem.ticolor}"
						:class="{
						'tr-right' : (index==0 || index==2 || index==3) && twoindex ==1,
						'tr-below' : index==1 && twoindex !=1,
						'tr-rightbelow' : index==1 && twoindex ==1,			
						}"
					>
						<input type="number"  disabled  v-if="twoitem.type==0"  v-model="twoitem.value" />
						<input type="number"
							 :class="index == xindex && twoindex == xindex1 && (xindex1 >= 0)  ? 'bagcolor': ''"
							 class="pitchon " @click="userinputClick(index,twoindex)"  disabled  v-if="twoitem.type==1 && bijishow == 0"  v-model="twoitem.uservalue" />
						<view class="bijique" v-if="twoitem.type==1 && bijishow == 1" @click="userinputClick(index,twoindex)"  :class="index == xindex && twoindex == xindex1  ? 'bagcolor': ''">
							<view v-for="(item,index) in twoitem.biji">{{item}}</view>	
						</view>	
					</div>
					
				</div>
			</div>
		</div>
		
		
	
		
	</div>
</template>

<script>
	export default {
		props: ['body','bijishow'],
		watch:{
			body(e){
				this.body  = e;
			}
		},
		data() {
			return {
				type : 0, 
				xindex : null,
				xindex1 : null
				
			}
		},
		created() {
			console.log(this.xindex);
			console.log(this.xindex1);
			console.log(this.body);
		},
		methods:{
			userinputClick(index,index1){
				this.xindex = index;
				this.xindex1 = index1;
				this.$emit('userinputChange',{'index':index,'index1':index1});
			},
			
		}
	}
</script>

<style>
	@import url("@/common/css/questions.css");
	.questions {
		display: flex;	
		
	}
	.questions-div {
		width: 738rpx;
		height: 780rpx;
		margin: auto;
	}
	.questions-body {
		width: 700rpx;
		height: 698rpx;
		border: 2rpx solid #000;
		box-shadow: inset 1px 1px 0 #e3e4e5;
		margin: auto;
		display: flex;
		flex-direction: column;
	}
	.tr4 {
		display: flex;
		flex: 1;
	}
	.bagcolor {
		background-color: #edff38;
		width: 98% !important;
		height: 98% !important;
	}
</style>